package org.example.DesignPatterns.Interpreter;

import java.util.List;

/**
 * @description:表达式序列
 * @author: farprt
 * @create: 2022-09-25 13:54
 **/
public class Sequence implements Expression {

    private List<Expression> expressions;

    public Sequence(List<Expression> expressions) {
        this.expressions = expressions;
    }

    @Override
    public void interpret() {
        expressions.forEach(expression -> expression.interpret());
    }
}